<?php
/**
 * Created by PhpStorm.
 * User: MR_THONG
 * Date: 2/3/2015
 * Time: 8:14 AM
 */
App::uses('AppController', 'Controller');
class MyPageController extends AppController {
        public function index(){
//            $this->loadModel('User');
//            $this->loadModel('Artical');
//            $this->loadModel('Tour');
//            $user = $this->User->findById(1);
//            $new = $user['Role'];
//            $artical = $this->Artical->findById(1);
//            $tour = $this->Tour->findById(1);
//            var_dump('testes');
//            var_dump($user);
//            var_dump($artical);
//            var_dump($tour);
            $this->loadModel('Tour');
            $newest_foriegn_tour = $this->Tour->find('first', array(
                'conditions' => array('Tour.tour_kind_id' => 1),
                'conditions' => array('Tour.is_national' => 1),
                'order' => array('Tour.created_date' => 'desc')
            ));
            $this->set('newestForiegnTour', $newest_foriegn_tour);

            $newTour = $this->Tour->find('all',array(
                    'conditions' => array('Tour.is_national' => 1),
                    'limit' => 8,
                    'order' => array('Tour.created_date' => 'desc')
            ));
            $this->set('newTour', $newTour);
    }
}